package cn.kgc.springcloud.client;

import cn.kgc.springcloud.entity.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: mosin
 * @version: v1.0  2023/1/4
 */
@FeignClient("ORDERS")  // 通过服务名称  获取通信节点
public interface OrderClient {

    @RequestMapping("/order/m1")
    String method1();
    @RequestMapping("/order/m2")  // @RequestParam  ? /order/m2?id=10
    String method2(@RequestParam("id") Integer id);

    @RequestMapping("/order/m3/{id}")  // @PathVariable   /order/m3/10
    String method3(@PathVariable("id") Integer id);

    @RequestMapping("/order/m4")  //  @RequestBody  以json格式组织参数
    String method4(@RequestBody Order order);

    @RequestMapping("/order/m5")
    Order method5(@RequestParam("id") Integer id);

}
